{% load staticfiles %}
{% load comment_tags %}

{% generate_form_for post as form %}
<div class="container-fluid" id="cmt-form">
{% if request.user.is_authenticated %}
    <div class="comment-header">
        <sapn class="comment-avatar">
            <img class="img-rounded" src="{% if user.socialaccount_set.all.0.get_avatar_url %}
{{ user.socialaccount_set.all.0.get_avatar_url }}{% else %}{% static 'image/1.png' %}{% endif %}">
        </sapn>
        <span><strong>
            {{ request.user.username }}
        </strong></span>
        <span class="fa fa-edit"></span>
        <span id="reply-to" style="display:none;">回复：<a class="reply-to-name" href="javascript:void(0);">@Cluas</a></span>
    </div>
    <form class="comment-form" method="post" action="{% url 'easy_comment:submit_comment' post.id %}">
        {% csrf_token %}
        {% for field in form %}
        {{ field }}
        {{ field.errors }}
        {% endfor %}
        <button class="btn btn-primary pull-right" type="submit">提交评论</button>
    </form>
    <button class="btn btn-danger pull-right" id="cancel-reply" style="display: none">取消</button>
{% else %}
    <div class="jumbotron">
        <h3 class="text-center">请用<a href="/accounts/weibo/login/"><span class="fa fa-weibo"></span></a>
            <a href="/accounts/github/login/"><span class="fa fa-github"></span></a>登陆后参与评论</h3>
    </div>
{% endif %}
</div>

<!-- 在非admin后台的地方使用django-ckeditor，需要引入这两个js -->
